import Vue from 'vue'
import VueRouter from 'vue-router'

import Router from 'vue-router'

const originalPush = Router.prototype.push
Router.prototype.push = function push(location, onResolve, onReject) {
    if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
    return originalPush.call(this, location).catch(err => err)
}

Vue.use(VueRouter)

const routes = [

    // {
    //     path: '/',
    //     name: 'LoginView',
    //     component: () => import('../homeworkView/LoginView.vue')
    // },
    //************lf
    // {
    //     path: '/',
    //     name: 'PromotionView',
    //     component: () => import('../lf_views/PromotionView.vue')
    // },
    {
        path: '/PromotionView',
        name: 'PromotionView',
        component: () => import('../lf_views/PromotionView.vue')
    },
    {
        path: '/',
        name: 'LoginCom',
        component: () => import('../lf_views/LoginCom.vue')
    },
    {
        path: '/LoginCom',
        name: 'LoginCom',
        component: () => import('../lf_views/LoginCom.vue')
    },
    {
        path: '/IndexView',
        name: 'IndexView',
        component: () => import('../lf_views/IndexView.vue')
    },
    {
        path: '/registerView',
        name: 'registerView',
        component: () => import('../lf_views/registerView.vue')
    },


    //********************views
    {
        path: '/GoodsView',
        name: 'GoodsView',
        component: () => import('../views/GoodsView.vue')
    },



    //************lhb

    {
        path: '/OrderView',
        name: 'OrderView',
        component: () => import('../lhb_views/OrderView.vue')
    },


    {
        path: '/RetreatView',
        name: 'RetreatView',
        component: () => import('../lhb_views/RetreatView.vue')
    },
    {
        path: '/CustomerView',
        name: 'CustomerView',
        component: () => import('../lhb_views/CustomerView.vue')
    },
    {
        path: '/goodsShelvesViews',
        name: 'goodsShelvesViews',
        component: () => import('../dhz_views/goodsShelvesViews')
    },

    /**zhj1
     * 采购计划
     */
    {
        path: '/BuyPlan',
        name: 'BuyPlan',
        component: () => import('../views/BuyPlan.vue')
    },
    /**zhj2
     * 供货单
     */
    {
        path: '/ProviderOrder',
        name: 'ProviderOrder',
        component: () => import('../views/ProviderOrder.vue')
    },
    /**zhj3
     * 出入库明细
     */
    {
        path: '/GoodsInDetail',
        name: 'GoodsInDetail',
        component: () => import('../views/GoodsInDetail.vue')
    },
    {
        path: '/GoodsOutDetail',
        name: 'GoodsOutDetail',
        component: () => import('../views/GoodsOutDetail.vue')
    },
    /**zhj4
     * 总库存页面
     */
    {
        path: '/ShoppingStorage',
        name: 'ShoppingStorage',
        component: () => import('../views/ShoppingStorage.vue')
    },
    {
        path: '/BatchView',
        name: 'BatchView',
        component: () => import('../views/BatchView')
    },

]

const router = new VueRouter({
    // mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
